// eslint-disable-next-line
import { UserLayout, BasicLayout, RouteView, BlankLayout, PageView } from '@/layouts'
import Demo from '@/views/demo'
import Test from '@/views/demo/test'
import Analysis from '@/views/demo/dashboard/Analysis'

/**
 * 基础路由 不需要权限的
 * @type
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      }
    ]
  }
]

/** 需要权限的 */
export const asyncRouterMap = [
  // ...constantRouterMap,
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      }
    ]
  },
  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: { title: '首页' },
    redirect: '/demo',
    children: [
      {
        path: 'demo',
        name: 'demo',
        meta: {
          title: 'demo模块',
          icon: 'account'
        },
        component: Demo,
        children: [
          {
            path: 'test',
            name: '',
            component: Test,
            meta: {
              title: 'test',
              icon: 'upload'
            }
          },
          {
            path: 'test',
            name: 'test',
            component: Analysis,
            meta: {
              title: 'test',
              icon: 'history'
            } 
          }
        ]
      }
    ]
  },
  {
    path: '*', redirect: '/404', hidden: true
  }
]
